(function($) {
    $.WS = {
        ajax: function(options) {
            var l = options.url;
            var d = options.data || {};
            var f = options.success || null;
            var a = typeof options.async != "undefined" ? options.async : true;
            d = JSON.stringify(d);
            $.ajax({
                type: "POST",
                contentType: "application/json",
                url: l,
                data: d,
                dataType: "json",
                success: function(data) {
                    if (f != null && data != null) {
                        f(data.d);
                    }
                },
                async: a
            });
        },

        getJSON: function(url, data, callback) {
            var l = url;
            var d = data || {};
            var f = callback || null;
            if ($.isFunction(data)) {
                f = data;
            }
            $.WS.ajax({
                url: l,
                data: d,
                success: f
            });
        }
    }
})(jQuery);